home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / ImageProducer.java < prev    next >
Text File  |  1998-09-22  |  4KB  |  91 lines

  1. /*
  2.  * @(#)ImageProducer.java    1.12 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt.image;
  16.  
  17. /**
  18.  * The interface for objects which can produce the image data for Images.
  19.  * Each image contains an ImageProducer which is used to reconstruct
  20.  * the image whenever it is needed, for example, when a new size of the
  21.  * Image is scaled, or when the width or height of the Image is being
  22.  * requested.
  23.  *
  24.  * @see ImageConsumer
  25.  *
  26.  * @version    1.12 07/01/98
  27.  * @author     Jim Graham
  28.  */
  29. public interface ImageProducer {
  30.     /**
  31.      * This method is used to register an ImageConsumer with the
  32.      * ImageProducer for access to the image data during a later
  33.      * reconstruction of the Image.  The ImageProducer may, at its
  34.      * discretion, start delivering the image data to the consumer
  35.      * using the ImageConsumer interface immediately, or when the
  36.      * next available image reconstruction is triggered by a call
  37.      * to the startProduction method.
  38.      * @see #startProduction
  39.      */
  40.     public void addConsumer(ImageConsumer ic);
  41.  
  42.     /**
  43.      * This method determines if a given ImageConsumer object
  44.      * is currently registered with this ImageProducer as one
  45.      * of its consumers.
  46.      */
  47.     public boolean isConsumer(ImageConsumer ic);
  48.  
  49.     /**
  50.      * This method removes the given ImageConsumer object
  51.      * from the list of consumers currently registered to
  52.      * receive image data.  It is not considered an error
  53.      * to remove a consumer that is not currently registered.
  54.      * The ImageProducer should stop sending data to this
  55.      * consumer as soon as is feasible.
  56.      */
  57.     public void removeConsumer(ImageConsumer ic);
  58.  
  59.     /**
  60.      * This method both registers the given ImageConsumer object
  61.      * as a consumer and starts an immediate reconstruction of
  62.      * the image data which will then be delivered to this
  63.      * consumer and any other consumer which may have already
  64.      * been registered with the producer.  This method differs
  65.      * from the addConsumer method in that a reproduction of
  66.      * the image data should be triggered as soon as possible.
  67.      * @see #addConsumer
  68.      */
  69.     public void startProduction(ImageConsumer ic);
  70.  
  71.     /**
  72.      * This method is used by an ImageConsumer to request that
  73.      * the ImageProducer attempt to resend the image data one
  74.      * more time in TOPDOWNLEFTRIGHT order so that higher
  75.      * quality conversion algorithms which depend on receiving
  76.      * pixels in order can be used to produce a better output
  77.      * version of the image.  The ImageProducer is free to
  78.      * ignore this call if it cannot resend the data in that
  79.      * order.  If the data can be resent, then the ImageProducer
  80.      * should respond by executing the following minimum set of
  81.      * ImageConsumer method calls:
  82.      * <pre>
  83.      *    ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >);
  84.      *    ic.setPixels(...);    // As many times as needed
  85.      *    ic.imageComplete();
  86.      * </pre>
  87.      * @see ImageConsumer#setHints
  88.      */
  89.     public void requestTopDownLeftRightResend(ImageConsumer ic);
  90. }
  91.